package org.yang.novel.wx.controller;

import org.yang.common.Msg;
import org.yang.novel.wx.entity.Type;
import org.yang.novel.wx.service.TypeService;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;

import javax.annotation.Resource;
/**
 * 分类控制器
 * @author shichenyang
 * @email gyv12345@163.com
 * @date 2019/01/07
 */
@RestController
@RequestMapping("/type")
public class TypeController {
    @Resource
    private TypeService typeService;

    @GetMapping("/getTypes")
    public PageInfo getTypes(Type type,Integer page,Integer limit){
        return typeService.getTypes(type,page,limit);
    }
    @PostMapping("/addType")
    public Msg addType(Type type){
        return typeService.addType(type);
    }

    @PutMapping("/updateType")
    public Msg updateType(Type type){
        return typeService.updateType(type);
    }

    @DeleteMapping("/delType")
    public Msg delType(Type type){
        return typeService.delType(type);
    }
}
